AIFF-C (and AIFF) files contain at most one instrument configuration.
For this format, you may use the constant AAAAFFFF____DDDDEEEEFFFFAAAAUUUULLLLTTTT____IIIINNNNSSSSTTTT to reference
the instrument data, but it is always safer to use aaaaffffGGGGeeeettttIIIInnnnssssttttIIIIDDDDssss(3dm).
AIFF-C (and AIFF) instrument configurations contain two loops, a _s_u_s_t_a_i_n
_l_o_o_p and a _r_e_l_e_a_s_e _l_o_o_p. You can determine the ID's for AIFF loops
directly (without calling aaaaffffGGGGeeeettttLLLLooooooooppppIIIIDDDDssss(3dm)) by calling
aaaaffffGGGGeeeettttIIIInnnnssssttttPPPPaaaarrrraaaammmmLLLLoooonnnngggg(3dm) with the parameters AAAAFFFF____IIIINNNNSSSSTTTT____SSSSUUUUSSSSLLLLOOOOOOOOPPPPIIIIDDDD and
AAAAFFFF____IIIINNNNSSSSTTTT____RRRREEEELLLLLLLLOOOOOOOOPPPPIIIIDDDD. Note that other formats may contain larger numbers of
loops, and these instrument parameters do not apply to them.
Once you know the ID for a loop, you can determine its play mode by
You can obtain marker ID's for the marker structures which contain the
endpoints for a loop by calling aaaaffffGGGGeeeettttLLLLooooooooppppSSSSttttaaaarrrrtttt(((()))) and aaaaffffGGGGeeeettttLLLLooooooooppppEEEEnnnndddd(((()))).
EEEEXXXXAAAAMMMMPPPPLLLLEEEE
aaaaffffGGGGeeeettttLLLLooooooooppppSSSSttttaaaarrrrtttt(((()))) returns the value 3. This is the ID of the marker in
the audio track which labels the beginning of the specified loop.
You call aaaaffffGGGGeeeettttMMMMaaaarrrrkkkkPPPPoooossssiiiittttiiiioooonnnn(3dm) with _m_a_r_k_i_d = 3 to obtain a sample frame
location in the track.
Suppose you retrieve the marker position 125000 for the loop start
marker, and marker position 150000 for the loop end marker. The loop
consists of sample frames 125001 through 150000.
Remember that markers are positioned "between" audio sample frames. See
the AIFF or AIFF-C spec for a detailed explanation of how markers and
loops work.
aaaaffffGGGGeeeettttLLLLooooooooppppTTTTrrrraaaacccckkkk(((()))) is included in the library as a placeholder for future
functionality. It always returns AAAAFFFF____DDDDEEEEFFFFAAAAUUUULLLLTTTT____TTTTRRRRAAAACCCCKKKK for now.
It is now possible to retrieve the loop start and end frame directly
without using the associated markers (see aaaaffffGGGGeeeettttLLLLooooooooppppSSSSttttaaaarrrrttttFFFFrrrraaaammmmeeee(3dm)).
This is useful and necessary for audio file formats which support loops
which are independent of any markers, and for formats which support loops
but which do not support markers at all. For formats which always
associate loops and markers, such as AAAAIIIIFFFFFFFF(4) and WWWWAAAAVVVVEEEE(4),
aaaaffffGGGGeeeettttLLLLooooooooppppSSSSttttaaaarrrrtttt(((()))) and aaaaffffGGGGeeeettttLLLLooooooooppppEEEEnnnndddd(((()))) will always return a valid ID for a
marker, but this marker may have been artifically generated by the AF.
If this is the case, the name of the marker (as retrieved via
aaaaffffGGGGeeeettttMMMMaaaarrrrkkkkNNNNaaaammmmeeee(3dm)) will be "start mark for loop id x" or "end mark for
loop id x", where _x is the loop ID.
CCCCAAAAVVVVEEEEAAAATTTTSSSS
These functions may return any number of loops within an inst, not just
the fixed value of 2 current found in AIFF/AIFF-C files. Other supported
file formats have different loop configurations than those in AIFF/AIFF-
C.
Applications may use the aaaaffffQQQQuuuueeeerrrryyyy(3dm) system to determine whether a
format supports loops and if so, the number allowed. A program should be
written to expect and ignore loop configurations it does not understand.